! Configuration File for keepalived


vrrp_instance VI_API {
    state {{ hostvars[inventory_hostname].MASTER }} #其他两台contoller设置为BACKUP
    interface {{ hostvars[inventory_hostname].api_iface }}  #选举通过那个网卡接口## 通过ifconfig查看
    virtual_router_id 201 
    priority {{ hostvars[inventory_hostname].priority }}  #其他机器小于100即可，该值为权值
    advert_int 1
    authentication {   #集群配置要相同
        auth_type PASS 
        auth_pass KEEPALIVED_PASS
    }
    track_script {
        chk_haproxy   #监测haproxy进程状态
    }
    virtual_ipaddress {
       {{ API_VIP }}    #配置VIP
    }
}

vrrp_instance VI_DASHBOARD {
    state {{ hostvars[inventory_hostname].MASTER }}  #其他两台contoller设置为BACKUP
    interface {{ hostvars[inventory_hostname].dashboard_iface  }} #选举通过那个网卡接口## 通过ifconfig查看
    virtual_router_id 201
    priority {{ hostvars[inventory_hostname].priority }}  #其他机器小于100即可，该值为权值
    advert_int 1
    authentication {   #集群配置要相同
        auth_type PASS
        auth_pass KEEPALIVED_PASS
    }
    track_script {
        chk_haproxy   #监测haproxy进程状态
    }
    virtual_ipaddress {
        {{ DASHBOARD_VIP }}
    }
}
